package oop.data;

import oop.db.dao.TestDAO;

public class TestVersion {

	private long id;
	private long testId;
	private TestVersionData data;
	private String code;

	public TestVersion(long id, String code, long testId, TestVersionData data) {
		this.id = id;
		this.code = code;
		this.testId = testId;
		this.data = data;
	}

	public String getCode() {
		return code;
	}

	public TestVersionData getData() {
		return data;
	}
	
	public long getId() {
		return id;
	}
	
	public Test getTest() {
		try {
			return TestDAO.fetchById(testId);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}
